package com.business.financial;

import java.lang.reflect.Method;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ZcfzEntity {
	public ZcfzEntity() {
	}


	private  double aa = 0;
	public void setObj(String objName, String objValue) {
		try {
			Class cls = Class.forName("com.business.financial.ZcfzEntity");
			Method methlist[] = cls.getMethods();
			String methodName = "set" + objName.substring(0, 1).toUpperCase() +
				objName.substring(1);
			//System.out.println("methodName");

			for (int i = 0; i < methlist.length; i++) {
				Method m = methlist[i];
				if (m.getName().equals(methodName)) {
					Object arglist[] = new Object[1];
					arglist[0] = objValue;
					ZcfzEntity view = (ZcfzEntity) Class.forName(
						"com.business.financial.ZcfzEntity").newInstance();
					m.invoke(view, arglist);
				}
			}
		}
		catch (Exception ex) {
			ex.printStackTrace();
		}
	}
	public void setObj(ZcfzEntity test,String objName, double objValue) {
		try {
			Class cls = Class.forName("com.business.financial.ZcfzEntity");
			Method methlist[] = cls.getMethods();
			String methodName = "set" + objName.substring(0, 1).toUpperCase() +
				objName.substring(1);
			//System.out.println("methodName");

			for (int i = 0; i < methlist.length; i++) {
				Method m = methlist[i];
				if (m.getName().equals(methodName)) {
					Object arglist[] = new Object[1];
					arglist[0] = new Double(objValue);
					m.invoke(test, arglist);
				}
			}
		}
		catch (Exception ex) {
			ex.printStackTrace();
		}
	}


	public void setAa(double aa) {
		this.aa = aa;
	}
	public double getAa() {
		return this.aa;
	}


	public static void main(String[] args) {
		ZcfzEntity test = new ZcfzEntity();
		test.setObj(test,"aa", 123.12);
		//test.setAa(123.2);
		System.out.println("aa last:==" + test.getAa());
	}

}
